Namespace Workflow

Partial Class GetFile
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub


    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim fileId As Integer = Request.QueryString("fileId")
            If fileId < 1 Then
                Response.Write("fileId not supplied")
                response.End()
            End If

            Dim file As CFile = CFile.Cache.GetById(fileId)
            Response.Clear()
            Response.ContentType = file.FileMimeType
            Response.AddHeader("Content-disposition", "attachment;filename=" & file.FileName)
            Response.WriteFile(EditItem.FolderPath & file.FileName)
            Response.End()
        End Sub

End Class

End Namespace
